<style>
    .ui-main > .el-divider .el-divider__text {
        background: #F2F2F2;
    }

    .ui-main > h3 {
        padding-left: 20px;
        font-size: 20px;
        border-left: 2px solid #409EFF;
        margin-left: 10px;
    }
</style>
<template>
<ly-page>
    <ly-navi type="title" title="DEMO1"></ly-navi>
    <ly-page-content>
        <ly-table-filter @search="store.load(1)" @add="add" >
            <el-form-item>
                <el-select v-model="store.params.status" placeholder="全部/未处理/已处理">
                    <el-option key="1" label="全部" value="1"></el-option>
                    <el-option key="2" label="未处理" value="2"></el-option>
                    <el-option key="3" label="已处理" value="3"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-select v-model="store.params.course_status" placeholder="课程状态">
                    <el-option key="1" label="未结束" value="1"></el-option>
                    <el-option key="2" label="已结束" value="2"></el-option>
                </el-select>
            </el-form-item>
        </ly-table-filter>
        <el-table v-table-affix :data="store.data" v-loading="store.loading" @sort-change="store.sort($event)">
            <el-table-column label="id" prop="id" sortable="customer">
            </el-table-column>
            <el-table-column label="名称" prop="name">
            </el-table-column>
        </el-table>
        <ly-pagination :store="store"></ly-pagination>
    </ly-page-content>
</ly-page>
</template>
<script>
    //这里定义组件
    Rap.define([], function () {
        return {
            data: function () {
                var store = Ly.dataStore({
                    data: function () {
                        var data = [];
                        for (var i = 0; i < 30; i++) {
                            data.push({id: i, name: 'name' + i})
                        }
                        return data;
                    }
                });
                store.load(1);
                return {
                    store: store

                }
            }, created: function () {

            }, init: function (query) {

            },
            methods: {
                add:function (){}
            }
        }
    })
</script>